package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkSpaceService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: WangHongKun
 * @Date: 2022/9/22 16:58
 * @Email: 2028911483@qq.com
 * @Phone: 18683977706
 */

@RestController
@Slf4j
@Api(tags = "工作台相关接口")
@RequestMapping("/admin/workspace")
public class WorkSpaceController {


    @Autowired
    private WorkSpaceService workSpaceService;

    @GetMapping("/businessData")
    @ApiOperation("查询今日运营数据接口")
    public Result<BusinessDataVO> getTodayBusinessData(){
        return Result.success(workSpaceService.getTodayBusinessData());
    }

    @GetMapping("/overviewOrders")
    @ApiOperation("订单管理的接口")
    public Result<OrderOverViewVO> getOverViewOrders(){
        return Result.success(workSpaceService.getOverViewOrders());
    }


    @GetMapping("/overviewDishes")
    @ApiOperation("菜品总览接口")
    public Result<DishOverViewVO>  getOverviewDishes(){
        return Result.success(workSpaceService.getOverviewDishes());
    }

    @GetMapping("/overviewSetmeals")
    @ApiOperation("套餐总览接口")
    public Result<SetmealOverViewVO>  getOverviewSetmeals(){
        return Result.success(workSpaceService.getOverviewSetmeals());
    }
}
